package com.srcptit.tranning.toannt.btvn1;
import java.util.Scanner;
public class Day_fibonacci {
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		System.out.println("nhap vao 1 so: ");
		int n = sc.nextInt();
		System.out.println(Fibonacci(n));
}
public static long Fibonacci(int n){
int a = 1, b = 1, c,dem =1;
if( n == 0 || n == 1) return 1;
while(true){
    c = a + b;
    dem++;
    if(dem == n) break;
    else{
        a = b;
        b = c;
    }
}
return c;
}
}
